package com.alibaba.enums;

import lombok.Getter;

/**
 * @author : hanyang
 * @date : 2023-11-04 15:34
 **/

@Getter
public enum CommentTypeEnum {

    ARTICLE(0, "文章评论"),
    LINK(1, "友链评论");

    private final Integer code;
    private final String description;

    CommentTypeEnum(Integer code, String description) {
        this.code = code;
        this.description = description;
    }

    public static CommentTypeEnum parseCode(Integer code) {
        for (CommentTypeEnum value : CommentTypeEnum.values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }



}
